package com.autoTools.view;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Panel;

import com.autoTools.util.Constants;
import com.autoTools.util.LogUtil;

public class PanelView extends BaseView
{
	private Panel mPanel = null;

	public PanelView()
	{
		mPanel = new Panel();
		mPanel.setEnabled(true);
		mPanel.setVisible(true);
		mPanel.setBounds(100, 100, 800, 600);
		BaseInit(mPanel);
	}

	public boolean addChild(BaseView child)
	{
		boolean state = false;
		if (child != null)
		{
			if (child.getParent() != null)
			{
				state = false;
			}else{
				if(child.getInstance() instanceof Component){
					mPanel.add((Component) child.getInstance(),child.getProperty().get(Constants.CONSTRAINTS));
					state = super.addChild(child);
				}else{
					LogUtil.sysLog(TAG, "addChild Error:child is not extends Component");
				}
			}
		}
		return state;
	}
}
